package chen.web;

import javax.sql.DataSource;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class ProviderInit implements ApplicationContextAware{
	
	@Autowired 
	public void setDataSource(DataSource dataSource){
		DataSourceProvider.setDataSource(dataSource);
	}

	@Override
	public void setApplicationContext(ApplicationContext context)
			throws BeansException {
		// TODO Auto-generated method stub
		ApplicationContextProvider.setApplicationContext(context);
	}
	
}
